﻿using System.Windows;
using System;

namespace WpfApp1
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        private double delta = 0;
        public MainWindow()
        {
            InitializeComponent();
            changes.Text = GridFirend.Width + "," + FriendList.Height;
            changew.Text = this.Width.ToString();

        }

        private void GridSplitter_DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e)
        {
            changes.Text = GridFirend.Width + "," + FriendList.Height;
            double t = GridFirend.Width.Value + e.HorizontalChange;
            changew.Text = this.Width.ToString();
            if (t < 50)
            {
                this.Width -= GridFirend.Width.Value - 50;
            }
            else if (t > 480)
            {
                this.Width += 480 - GridFirend.Width.Value;

            }
            else
            {
                this.Width += e.HorizontalChange;
            }
        }
    }
}
